home *** CD-ROM | disk | FTP | other *** search
- Path: news.u-net.com!news
- From: charlotte@parmo.u-net.com (Thomas Christensen)
- Newsgroups: comp.lang.c++
- Subject: How to prototype a class?
- Date: Thu, 15 Feb 1996 15:28:46 GMT
- Organization: U-NET limited
- Message-ID: <4fvjhe$c6o@nuntius.u-net.net>
- Reply-To: thc@mailhost.net
- NNTP-Posting-Host: parmo.u-net.com
- X-Newsreader: Forte Free Agent v0.55
-
- Hi All
-
- In trying to compile the following code example from the VC4 knowledge
- base, I get "error C2653: 'B' : is not a class or namespace name"
- on the line with 'friend int B::Func1(A);.
-
- class A
- {
- private:
- int _a;
- friend int B::Func1( A ); // Grant friend access to one
- // function in class B.
- };
-
- class B
- {
- public:
- int Func1( A a ) { return a._a; } // OK: this is a friend.
- };
-
- How can I work my way around this problem?
-
- Thomas Christensen
-
- (Please post and e-mail)
- E-mail: thc@mailhost.net
- E-mail: thc@mailhost.net
-
-